object DMDodatkiOsoby: TDMDodatkiOsoby
  OldCreateOrder = False
  OnCreate = DataModuleCreate
  Height = 344
  Width = 430
  object ADQRodzajeDodatkow: TADQuery
    SQL.Strings = (
      'select * '
      'from RodzajeDodatkow '
      'order by chRodzaj')
    Left = 56
    Top = 8
  end
  object ADQDodatki: TADQuery
    SQL.Strings = (
      'select D.*, '#39'nowa'#39' as stan, '#39'1'#39' as sort'
      'from DodatkiView d'
      'where D.inKRS = :KRS'
      '  and D.pub_dodany = :pub'
      '  and D.data_dodany = :data'
      '  and D.idOsoby = :idOsoby'
      'union all'
      'select D.*, '#39'skasowana'#39' as stan, '#39'2'#39' as sort'
      'from DodatkiView d'
      'where D.inKRS = :KRS'
      '  and D.pub_skasowany = :pub'
      '  and D.data_skasowany = :data'
      '  and D.idOsoby = :idOsoby'
      'union all'
      'select D.*, '#39'jest'#39' as stan, '#39'3'#39' as sort'
      'from DodatkiView d'
      'where D.inKRS = :KRS'
      
        '  and (D.data_dodany < :data or (D.data_dodany = :data and D.pub' +
        '_dodany < :pub))'
      
        '  and ((D.data_skasowany > :data or (D.data_skasowany = :data an' +
        'd D.pub_skasowany > :pub)) '
      #9'   or '
      '       (D.pub_skasowany is null and D.data_skasowany is null)) '
      ' and D.idOsoby = :idOsoby'
      'order by D.chRodzaj, sort')
    Left = 172
    Top = 8
    ParamData = <
      item
        Name = 'KRS'
        ParamType = ptInput
      end
      item
        Name = 'PUB'
        ParamType = ptInput
      end
      item
        Name = 'DATA'
        ParamType = ptInput
      end
      item
        Name = 'IDOSOBY'
        ParamType = ptInput
      end
      item
        Name = 'KRS'
        ParamType = ptInput
      end
      item
        Name = 'PUB'
        ParamType = ptInput
      end
      item
        Name = 'DATA'
        ParamType = ptInput
      end
      item
        Name = 'IDOSOBY'
        ParamType = ptInput
      end
      item
        Name = 'KRS'
        ParamType = ptInput
      end
      item
        Name = 'DATA'
        ParamType = ptInput
      end
      item
        Name = 'DATA'
        ParamType = ptInput
      end
      item
        Name = 'PUB'
        ParamType = ptInput
      end
      item
        Name = 'DATA'
        ParamType = ptInput
      end
      item
        Name = 'DATA'
        ParamType = ptInput
      end
      item
        Name = 'PUB'
        ParamType = ptInput
      end
      item
        Name = 'IDOSOBY'
        ParamType = ptInput
      end>
  end
  object ADQidRodzajeDodatkow: TADQuery
    SQL.Strings = (
      'select idRodzajeDodatkow '
      'from RodzajeDodatkow '
      'where chRodzaj = :rodzaj')
    Left = 56
    Top = 80
    ParamData = <
      item
        Name = 'RODZAJ'
        ParamType = ptInput
      end>
  end
  object ADQZapiszDodatki: TADQuery
    Left = 264
    Top = 8
  end
  object ADQDodajDodatki: TADQuery
    Left = 168
    Top = 80
  end
  object ADQUsunDodatki: TADQuery
    Left = 56
    Top = 144
  end
end
